Skip to content

Enable guest debugging for HyperV on windows #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dblnz
Copy link
Contributor

@dblnz dblnz commented May 9, 2025

Description

This closes #241

This brings the same debugging behavior to windows guests as kvm and mshv guests have on linux.
Some of the duplicated debug logic that is implemented on each hypervisor driver will be refactored later in a single implementation.

Copilot Generated Description

This pull request introduces significant updates to the Hyperlight debugging functionality, expanding support to Windows environments, refactoring the codebase to improve modularity, and enhancing the debugging capabilities. The most important changes include adding Windows-specific signal handling, introducing the HypervDebug struct for Hyper-V guest debugging, and removing Linux-specific dependencies from cross-platform code.

Cross-platform debugging enhancements:

Windows debugging support:

Refactoring for improved modularity:

Documentation updates:

These changes collectively enhance the flexibility of Hyperlight's debugging capabilities, making it more robust and suitable for cross-platform use.

@dblnz dblnz added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label May 9, 2025
@ludfjig
Copy link
Contributor

ludfjig commented May 15, 2025

Nice. Any chance we could land this after #469? :P

@dblnz
Copy link
Contributor Author

dblnz commented May 17, 2025

Yes, I was thinking on doing that to be less work for solving conflicts

@dblnz dblnz force-pushed the gdb-debugging-windows branch 2 times, most recently from 9afdaba to c5caf69 Compare June 11, 2025 15:17
@dblnz dblnz marked this pull request as ready for review June 11, 2025 15:18
@dblnz dblnz changed the title Enable debugging on windows Enable guest debugging for HyperV on windows Jun 11, 2025
dblnz added 2 commits June 18, 2025 14:39
- Previously, interrupting a running vCPU under debug meant directly sending a SIGINT signal,
since we have a way to handle interrupt sending, there is no need to do that.

Signed-off-by: Doru Blânzeanu <[email protected]>
@dblnz dblnz force-pushed the gdb-debugging-windows branch from c5caf69 to bde9c7d Compare June 18, 2025 12:08
Copy link
Contributor

@simongdavies simongdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, One small comment, lets get @ludfjig to review this one last time before we merge

@@ -90,7 +90,7 @@ fn main() -> Result<()> {
// Essentially the kvm and mshv features are ignored on windows as long as you use #[cfg(kvm)] and not #[cfg(feature = "kvm")].
// You should never use #[cfg(feature = "kvm")] or #[cfg(feature = "mshv")] in the codebase.
cfg_aliases::cfg_aliases! {
gdb: { all(feature = "gdb", debug_assertions, any(feature = "kvm", feature = "mshv2", feature = "mshv3"), target_os = "linux") },
gdb: { all(feature = "gdb", debug_assertions, any(feature = "kvm", feature = "mshv2", feature = "mshv3")) },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need any(feature = "kvm", feature = "mshv2", feature = "mshv3") since its now enabled for all hypervisors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support debugging Hyperlight on Windows
3 participants